home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
ffccflow
/
ffccflow.lha
/
ffccc+flow
/
ffccc
/
floppy.vmshlp
< prev
next >
Wrap
Text File
|
1992-07-31
|
9KB
|
284 lines
1 FLOPPY
Floppy is a program which checks that an input file of Fortran
code complies with a set of coding conventions.
There is a "FLOPPY User Guide" DD/US/112 available in the UCO,
Batiment 512, Tel. 4952.
FLOPPY can also produce output for the FLOW program, a tool
which analyses the structure of Fortran code. Type HELP FLOW
for details.
There are some extra features which are described below.
For problems with FLOPPY or FLOW contact VXCERN::JULIAN (Tel.5029)
Format:
FLOPPY [filename]
NB Floppy uses FLOP (DD/US/13 Flop User's Guide by H.Grote)
to parse the source Fortran.
2 Parameters
filename
Specifies the name of the input file of FORTRAN upon which the
coding convention checks are to be made. The code must be
standard FORTRAN 77, and must have compiled without errors,
otherwise the results from using FLOPPY will be unreliable.
You may use wild-cards in the filename; if more than one file
is found matching the specification, then the files will be
internally concatenated.
Note that non-standard constructs such as INCLUDE statements
will be treated as illegal statements by FLOPPY, and ignored.
If you are using FLOPPY to tidy your Fortran (see /TIDY option),
then 'filename' may be for instance an EDITF.DAT extracted
with HISTORIAN option S, or likewise may be a file where the
COMMON block declarations are hidden in INCLUDE statements. This
will not jeopardize the indentation of DO loops and IF clauses,
nor the re-numbering of statement labels.
2 Qualifiers
/CHECKS
/CHECKS[=(n[,.....])]
/NOCHECKS
Define the coding convention checks to be made.
If no list is given, then the checks marked by a '*'
in the list below are made.
If n=99 then all checks are made
If /NOCHECKS is specified then no checks are made.
If n is negative, then check number n is not made.
Thus to make all the checks except numbers 3 and 31,
specify /CHECKS=(99,-3,-31). See the Examples.
The coding convention numbering (n) is as follows:
* Check no. 1 Avoid comment lines after end of module
* Check no. 2 End all program modules with the END statement
* Check no. 3 Declared COMMON blocks must be used in the module
* Check no. 4 COMPLEX and DOUBLEPRECISION vars at end of COMMON
* Check no. 5 COMMON block definitions should not change
* Check no. 6 Variable names should be 6 or less characters long
Check no. 7 Variables in COMMON should be 6 characters long
Check no. 8 Variables not in COMMON should be <6 characters
* Check no. 9 Integer variables should begin with I to N
* Check no. 10 Variable names should not equal FORTRAN keywords
* Check no. 11 Avoid comment lines before module declaration
* Check no. 12 Module names should not equal intrinsic functions
* Check no. 13 First statement in a module should be declaration
* Check no. 14 Module should begin with at least 3 comment lines
Check no. 15 Comment lines should begin with a C
* Check no. 16 No comment lines between continuations
* Check no. 17 Avoid non-standard variable types eg INTEGER*2
* Check no. 18 Avoid multiple COMMON definitions per line
* Check no. 19 Do not dimension COMMON variables outside COMMON
* Check no. 20 Avoid embedded blanks in variable names
* Check no. 21 Avoid embedded blanks in syntactic entities
* Check no. 22 Avoid the use of PRINT statements (use WRITE)
Check no. 23 Do not give the END statement a label
* Check no. 24 Avoid WRITE(* construction
Check no. 25 Avoid WRITE statement in a FUNCTION
* Check no. 26 Avoid the use of PAUSE statements
* Check no. 27 Statement labels should not begin in column 1
* Check no. 28 Always precede STOP by a descriptive WRITE
* Check no. 29 Avoid the use of ENTRY in FUNCTIONS
* Check no. 30 Avoid using I/O in FUNCTIONs
Check no. 31 Avoid the use of the alternate RETURN statement
* Check no. 32 COMMON block names should not equal variable names
* Check no. 33 Avoid use of obsolete CERN library routines
Check no. 34 Avoid FUNCTION names the same as intrinsics
* Check no. 35 Local functions should be declared EXTERNAL
* Check no. 36 Module names should all be different
* Check no. 37 Avoid expressions of mixed mode eg A=B/I
* Check no. 38 Length of passed CHARACTER variables should be *
* Check no. 39 Order of statements should conform to note
* Check no. 40 Separate Statement Functions by comment lines
* Check no. 41 No names in Statement Function definitions elsewhere
Check no. 42 Use LLT,LGT etc to compare CHARACTER vars. in IFs
Check no. 43 Variables (not COMMON, not PARAMs) <6 characters
* Check no. 44 Passed arguments should be dimensioned * in module
/TREE
/TREE
Cause a summary output file to be produced, containing a packed
description of the source FORTRAN. The summary file contains
such information as the list of all FORTRAN module names, their
arguments, calling list, and so on. The file is unformatted; it
should be used as input to an auxiliary tool called TREE, and
is unreadable at the terminal.
/OUTPUT
/OUTPUT[=filename]
Cause the output from FLOPPY (normally viewed at the terminal)
to be sent to a disk file. If filename is not specified the
output file will have the stem name of the source FORTRAN file,
with an extension of .FLOPLIS .
/FULL
/FULL
Cause all source FORTRAN statements to be output, as opposed to
only those breaking the specified coding conventions.
/IGNORE
/IGNORE=(name[,.....])
Specify a list of FORTRAN module and variable names to be
ignored when the coding convention checks are made. Specify
module names by preceding the name with a # sign e.g. #MINUIT,
specify variable names normally.
/SPECIAL
/SPECIAL[=type]
Specify that a special version of FLOPPY be used. The default
'special' version is STANDARD, which causes those checks marked
by a '*' (see /CHECKS) to be implemented.
STANDARD : Use the standard check set.
ALEPH : Use the standard ALEPH check set.
ONLINE : Use the check set for Online Programs (not yet available).
GALEPH : Variables beginning with G..... or xG.... are ignored.
Other special versions may be defined on request to the author.
/LOG
/LOG
/NOLOG
Show a summary of the FLOPPY command parsing, or not.
/OLD
/OLD[=filename]
Each time FLOPPY is run, an "IGNORE" file is written with the
user specifications for that particular run. If the /OLD
qualifier is used, one may specify an already existing "IGNORE"
file. If the filename is omitted, then the filename used is
obtained from the stem of the source FORTRAN file and the
extension .FLOPIGN .
Note that this qualifier does not affect the use of /TIDY
as the FORTRAN tidying parameters are not stored in the "IGNORE"
file.
2 /TIDY
Write a new file of FORTRAN after re-formatting the input
according to the qualifiers specified.
Format:
FLOPPY/TIDY [filename]
The TIDY qualifier must be accompanied by at least one of the
following qualifiers. If all you want to do is TIDY your Fortran,
then use the /NOCHECKS qualifier as well.
3 Qualifiers
/FORTRAN
/FORTRAN[=filename]
Cause the reformatted FORTRAN output to be written on the filename
specified. If no filename is given, then the output Fortran is
written to a file called FORTRAN.FOR .
/GOTOS
/GOTOS
Right adjust all GOTO statements so that they finish in column 72.
/INDENT
/INDENT[=n]
Indent DO and IF clauses by the specified number of spaces. The
default is 3, and if specified, n should be in the range 1 to 5.
/FORMAT
/FORMAT[=(START=n,STEP=m)]
Re-number FORTRAN statements starting at n and stepping by m.
/GROUPF
/GROUPF
Group all FORMAT statements at the bottom of each module in which
they appear.
/STMNTS
/STMNTS[=(START=n,STEP=m)]
Re-number all statements (not FORMATs) starting at n and stepping
by m.
2 Examples
$ FLOPPY myfile.for
Make all the available coding convention checks on the FORTRAN
file myfile.for.
$ FLOPPY/TREE/NOCHECKS myfile.for
Produce a TREE output file, and make no checks.
$ FLOPPY/IGNORE=(FRED,#MICHEL) myfile.for
Make all the available checks, but ignore the variable called
FRED and the subroutine called MICHEL.
$ FLOPPY/CHECKS=(1,5,25,3)/FULL myfile.for
Check conventions 1,3,5 and 25, and list all lines from the
source FORTRAN.
$ FLOPPY/CHECKS=(99,-1,-2,-20) my*.for
Check all conventions except numbers 1,2 and 20. Use all files
beginning 'MY' and with filetype .FOR .
$ FLOPPY/NOLOG/OUT=output.lis myfile.for
Send the FLOPPY output to a listing file, and disable the command
parsing information.
$ FLOPPY/NOCHECKS/TIDY/INDENT=2 myfile.for
Produce a new FORTRAN file with all DO and IF clauses indented by
two spaces. No coding convention checking is done. The new
fortran will be called FORTRAN.FOR.
$ FLOPPY/TIDY/STMNTS=(START=10,STEP=5)/FORTRAN=out.for myfile.for
Renumber statements starting at 10 (10, 15, 20 etc.) and write
the new FORTRAN to the file out.for.